
#include "GameState/Master/MainMenu.h"
#include "Engine/Synaptic/Misc.h"

namespace GameState {

namespace Master {

MasterEntry::MasterEntry(const Misc::Frame & frame, std::string graphicName) :
	MenuEntry(frame, graphicName),
	Visual("masterGameState"), Reason("masterGameState"),
	entryFg(graphicName, "screen/master", 1),
	menuAnimation(10),
	focused(false) {

	entryFg.setPosition(frame.x, frame.y);
	entryFg.setFrameSize(frame.w, frame.h);
	menuAnimation.setReverse(true);
}

// Menu entry was selected
Engine::Resource::GraphicList MasterEntry::display() {

	Engine::Resource::GraphicList gfxList;
	gfxList.push_back(&entryFg);
	//gfxList.push_back(&entryBg);
	return gfxList;
}

void MasterEntry::pulse(int delta) {
	entryFg.setFrame(menuAnimation.update(delta), 0);
}

void MasterEntry::haveFocus(bool focused) {
	this->focused = focused;
	menuAnimation.setReverse(!focused);
}

MasterEntry::~MasterEntry(){
}

EntryBegin::EntryBegin(const Misc::Frame & frame) : MasterEntry(frame, "menuBegin")  {
}

EntryExit::EntryExit(const Misc::Frame & frame) : MasterEntry(frame, "menuExit") {
}

EntryOptions::EntryOptions(const Misc::Frame & frame) : MasterEntry(frame, "menuOptions")  {
}


} // namespace GameState::Master

} // namespace GameState
